from typing import Generator
from sqlalchemy.orm import Session
from app.db.database import SessionLocal  # Use SessionLocal from MySQL setup

def get_db() -> Generator[Session, None, None]:
    """Dependency function to get DB session."""
    db = SessionLocal()
    try:
        yield db
    finally:
        db.close() 